package com.xyzq.hs;

import com.xyzq.hs.util.ConfigUtils;
import com.xyzq.hs.util.Logger;
import com.xyzq.hs.util.LoggerFactory;

public class TSClientFactory {
	static Logger log=LoggerFactory.getLogger(TSClientFactory.class);
	
	private static String host=null; 
	private static Integer port=null; 
	private static Integer timeout=10000;
	
	private static TSClient client;
	
	private TSClientFactory(){
	}
	
	
	static{
		host = ConfigUtils.get("server.host");
		port = Integer.parseInt(ConfigUtils.get("server.port"));
		timeout = Integer.parseInt(ConfigUtils.get("server.timeout"));
		client=new TSClientImpl(host,port,timeout);
		log.info("Server information \n Host:{},\n Port:{},\n timeout:{}",host,port,timeout);
	}
	
	public static TSClient getClient(){
		return client;
	}
	
	public static void main(String[] args) throws ClassNotFoundException {
		Class.forName("com.xyzq.hs.TSClientFactory");
	}
}
